package com.example.chinesenation.Service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.chinesenation.Entity.Article;
import com.example.chinesenation.Mapper.ArticleMapper;
import com.example.chinesenation.Service.IArticleService;
import com.example.chinesenation.VO.VOArticle;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author sakuraFallingDown
 * @since 2021-01-12
 */
@Service
@Configuration
public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> implements IArticleService {
    @Override
    @Transactional(isolation = Isolation.DEFAULT,propagation = Propagation.REQUIRED)
    public void updateAddPageview(VOArticle article) {
        Article article1=new Article();
        article1.setId(article.getId());
        article1.setPageview(article.getPageview());
        updateById(article1);
    }
}
